webpackJsonp([180],{

/***/ 1823:
/***/ (function(module, exports) {

module.exports = {
  "content": [
    "section",
    [
      "p",
      [
        "code",
        "LocaleProvider"
      ],
      " provides a uniform localization support for built-in text of components."
    ],
    [
      "h2",
      "Usage"
    ],
    [
      "p",
      [
        "code",
        "LocaleProvider"
      ],
      " takes use of ",
      [
        "a",
        {
          "title": null,
          "href": "https://facebook.github.io/react/docs/context.html"
        },
        "context"
      ],
      ", a feature of React, to accomplish global effectiveness by wrapping the app only once."
    ],
    [
      "pre",
      {
        "lang": "jsx",
        "highlighted": "<span class=\"token keyword\">import</span> <span class=\"token punctuation\">{</span> LocaleProvider <span class=\"token punctuation\">}</span> <span class=\"token keyword\">from</span> <span class=\"token string\">'antd'</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">import</span> fr_FR <span class=\"token keyword\">from</span> <span class=\"token string\">'antd/lib/locale-provider/fr_FR'</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">import</span> <span class=\"token string\">'moment/locale/fr'</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token operator\">...</span>\n\n<span class=\"token keyword\">return</span> <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>LocaleProvider</span> <span class=\"token attr-name\">locale</span><span class=\"token script language-javascript\"><span class=\"token punctuation\">=</span><span class=\"token punctuation\">{</span>fr_FR<span class=\"token punctuation\">}</span></span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>App</span> <span class=\"token punctuation\">/></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>LocaleProvider</span><span class=\"token punctuation\">></span></span><span class=\"token punctuation\">;</span>"
      },
      [
        "code",
        "import { LocaleProvider } from 'antd';\nimport fr_FR from 'antd/lib/locale-provider/fr_FR';\nimport 'moment/locale/fr';\n\n...\n\nreturn <LocaleProvider locale={fr_FR}><App /></LocaleProvider>;"
      ]
    ],
    [
      "p",
      "We provide some locale like English, Chinese, Russian, German, French and etc, all locale packages can be found in ",
      [
        "a",
        {
          "title": null,
          "href": "https://github.com/ant-design/ant-design/blob/master/components/locale-provider/"
        },
        "here"
      ],
      "."
    ],
    [
      "p",
      "Note: if you need to use antd's UMD dist file, please use ",
      [
        "code",
        "antd/dist/antd-with-locales.js"
      ],
      " and corresponding moment locale:"
    ],
    [
      "pre",
      {
        "lang": "jsx",
        "highlighted": "<span class=\"token keyword\">const</span> <span class=\"token punctuation\">{</span> LocaleProvider<span class=\"token punctuation\">,</span> locales <span class=\"token punctuation\">}</span> <span class=\"token operator\">=</span> window<span class=\"token punctuation\">.</span>antd<span class=\"token punctuation\">;</span>\n\n<span class=\"token operator\">...</span>\n\n<span class=\"token keyword\">return</span> <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>LocaleProvider</span> <span class=\"token attr-name\">locale</span><span class=\"token script language-javascript\"><span class=\"token punctuation\">=</span><span class=\"token punctuation\">{</span>locales<span class=\"token punctuation\">.</span>fr_FR<span class=\"token punctuation\">}</span></span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>App</span> <span class=\"token punctuation\">/></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>LocaleProvider</span><span class=\"token punctuation\">></span></span><span class=\"token punctuation\">;</span>"
      },
      [
        "code",
        "const { LocaleProvider, locales } = window.antd;\n\n...\n\nreturn <LocaleProvider locale={locales.fr_FR}><App /></LocaleProvider>;"
      ]
    ],
    [
      "h3",
      "Add a new language"
    ],
    [
      "p",
      "If you can't find your language, you are welcome to create a locale package based on ",
      [
        "a",
        {
          "title": null,
          "href": "https://github.com/ant-design/ant-design/blob/master/components/locale-provider/en_US.tsx"
        },
        "en_US"
      ],
      " and send us a pull request."
    ],
    [
      "h3",
      "Other localization needs"
    ],
    [
      "p",
      "This component aims for localization of the built-in text, if you want to support other documents, we recommend using ",
      [
        "a",
        {
          "title": null,
          "href": "https://github.com/yahoo/react-intl"
        },
        "react-intl"
      ],
      ", refer to ",
      [
        "a",
        {
          "title": null,
          "href": "http://github.com/ant-design/intl-example"
        },
        "Intl demo 1"
      ],
      " and ",
      [
        "a",
        {
          "title": null,
          "href": "http://yiminghe.me/learning-react/examples/react-intl.html?locale=en-US"
        },
        "Intl demo 2"
      ],
      "."
    ]
  ],
  "meta": {
    "category": "Components",
    "type": "Other",
    "cols": 1,
    "title": "LocaleProvider",
    "filename": "components/locale-provider/index.en-US.md"
  },
  "toc": [
    "ul",
    [
      "li",
      [
        "a",
        {
          "className": "bisheng-toc-h2",
          "href": "#Usage",
          "title": "Usage"
        },
        "Usage"
      ]
    ],
    [
      "li",
      [
        "a",
        {
          "className": "bisheng-toc-h2",
          "href": "#API",
          "title": "API"
        },
        "API"
      ]
    ]
  ],
  "api": [
    "section",
    [
      "h2",
      "API"
    ],
    [
      "table",
      [
        "thead",
        [
          "tr",
          [
            "th",
            "Property"
          ],
          [
            "th",
            "Description"
          ],
          [
            "th",
            "Type"
          ],
          [
            "th",
            "Default"
          ]
        ]
      ],
      [
        "tbody",
        [
          "tr",
          [
            "td",
            "locale"
          ],
          [
            "td",
            "language package setting, you can find the packages in ",
            [
              "a",
              {
                "title": null,
                "href": "http://unpkg.com/antd/lib/locale-provider/"
              },
              "antd/lib/locale-provider"
            ]
          ],
          [
            "td",
            "object"
          ],
          [
            "td",
            "-"
          ]
        ]
      ]
    ]
  ]
};

/***/ })

});